package demo5_p;

public class Dog extends  Animal {

    //因为父类有构造方法，所以子类必须调用父类的构造方法
    public Dog(String name, int age) {
        super(name, age);
    }

    public void bark() {
        System.out.println(this.name + "汪汪汪");
    }
    @Override
    public  void eat() {
        System.out.println(this.name + "吃狗粮");
    }

    public Dog a(){
        return new Dog("小黄", 2);
    }
}